{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport AnchorContext from './context';\nvar AnchorLink = function AnchorLink(props) {\n  var _props$href = props.href,\n    href = _props$href === void 0 ? '#' : _props$href,\n    title = props.title,\n    customizePrefixCls = props.prefixCls,\n    children = props.children,\n    className = props.className,\n    target = props.target;\n  var context = React.useContext(AnchorContext);\n  var _ref = context || {},\n    registerLink = _ref.registerLink,\n    unregisterLink = _ref.unregisterLink,\n    scrollTo = _ref.scrollTo,\n    onClick = _ref.onClick,\n    activeLink = _ref.activeLink;\n  React.useEffect(function () {\n    registerLink === null || registerLink === void 0 ? void 0 : registerLink(href);\n    return function () {\n      unregisterLink === null || unregisterLink === void 0 ? void 0 : unregisterLink(href);\n    };\n  }, [href, registerLink, unregisterLink]);\n  var handleClick = function handleClick(e) {\n    onClick === null || onClick === void 0 ? void 0 : onClick(e, {\n      title: title,\n      href: href\n    });\n    scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);\n  };\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls;\n  var prefixCls = getPrefixCls('anchor', customizePrefixCls);\n  var wrapperClassName = classNames(\"\".concat(prefixCls, \"-link\"), className, _defineProperty({}, \"\".concat(prefixCls, \"-link-active\"), activeLink === href));\n  var titleClassName = classNames(\"\".concat(prefixCls, \"-link-title\"), _defineProperty({}, \"\".concat(prefixCls, \"-link-title-active\"), activeLink === href));\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName\n  }, /*#__PURE__*/React.createElement(\"a\", {\n    className: titleClassName,\n    href: href,\n    title: typeof title === 'string' ? title : '',\n    target: target,\n    onClick: handleClick\n  }, title), children);\n};\nexport default AnchorLink;","map":{"version":3,"names":["classNames","React","ConfigContext","AnchorContext","AnchorLink","props","href","title","customizePrefixCls","prefixCls","children","className","target","context","useContext","registerLink","unregisterLink","scrollTo","onClick","activeLink","useEffect","handleClick","e","getPrefixCls","wrapperClassName","titleClassName","createElement"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/anchor/AnchorLink.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport AnchorContext from './context';\nconst AnchorLink = props => {\n  const {\n    href = '#',\n    title,\n    prefixCls: customizePrefixCls,\n    children,\n    className,\n    target\n  } = props;\n  const context = React.useContext(AnchorContext);\n  const {\n    registerLink,\n    unregisterLink,\n    scrollTo,\n    onClick,\n    activeLink\n  } = context || {};\n  React.useEffect(() => {\n    registerLink === null || registerLink === void 0 ? void 0 : registerLink(href);\n    return () => {\n      unregisterLink === null || unregisterLink === void 0 ? void 0 : unregisterLink(href);\n    };\n  }, [href, registerLink, unregisterLink]);\n  const handleClick = e => {\n    onClick === null || onClick === void 0 ? void 0 : onClick(e, {\n      title,\n      href\n    });\n    scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);\n  };\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('anchor', customizePrefixCls);\n  const wrapperClassName = classNames(`${prefixCls}-link`, className, {\n    [`${prefixCls}-link-active`]: activeLink === href\n  });\n  const titleClassName = classNames(`${prefixCls}-link-title`, {\n    [`${prefixCls}-link-title-active`]: activeLink === href\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName\n  }, /*#__PURE__*/React.createElement(\"a\", {\n    className: titleClassName,\n    href: href,\n    title: typeof title === 'string' ? title : '',\n    target: target,\n    onClick: handleClick\n  }, title), children);\n};\nexport default AnchorLink;"],"mappings":";AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,aAAa,MAAM,WAAW;AACrC,IAAMC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